<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/public/head.jsp" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>后台管理系统-登录</title>
    <link rel="shortcut icon" href="${system}/static/favicon.ico">
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
    <link href="${system}/static/css/bootstrap.min.css" rel="stylesheet">
    <link href="${system}/static/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="${system}/static/css/animate.css" rel="stylesheet">
    <link href="${system}/static/css/style.css" rel="stylesheet">
    <link href="${system}/static/css/login.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location;
        }
    </script>

</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-7">
                <div class="signin-info">
                    <div class="logopanel m-b">
                        <h1>[ 会员钱包 ]</h1>
                    </div>
                    <div class="m-b"></div>
                    <h4>欢迎使用 <strong>会员钱包管理系统</strong></h4>
                </div>
            </div>
            <div class="col-sm-5">
                <h4 class="no-margins">登录：</h4>
                <p class="m-t-md" id="alert">登录到会员钱包管理系统</p>
                <input type="text" id="admin_number" class="form-control uname" placeholder="用户名" />
                <input type="password" id="admin_password" class="form-control pword m-b" placeholder="密码" />
                <button id="login" class="btn btn-success btn-block">登录</button>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
            	
            </div>
        </div>
    </div>
</body>
<script>


    $("#login").click(function () {
        var admin_number=$("#admin_number").val();
        var admin_password=$("#admin_password").val();

        var numberReg=/^(\w){6,16}$/;
        var passwordReg = /^[\w_-]{6,16}$/; 
        if (!numberReg.test(admin_number)){
            $("#admin_number").css("border-color","red");
            $("#alert").css("color","red");
            $("#alert").text("请输入符号要求的用户名");
            return;
        }else {
            $("#admin_number").css("border-color","white");
            $("#alert").text("登录到会员钱包管理系统");
            $("#alert").css("color","white");
        }
        if (!passwordReg.test(admin_password)){
            $("#admin_password").css("border-color","red");
            $("#alert").css("color","red");
            $("#alert").text("请输入符号要求的密码");
            return;
        }else {
            $("#admin_password").css("border-color","white");
            $("#alert").css("color","white");
            $("#alert").text("登录到会员钱包管理系统");
        }
        var data={"admin_number":admin_number,"admin_password":hex_md5(admin_password).toUpperCase()};
        ajax("${system}/admin/login.do",data,"text","post",true,function (data) {
            if (data=="success"){
                window.location.href="${system}/index";
            }else {
                $("#alert").css("color","red");
                $("#alert").text("用户名或密码错误");
            }
        },function (error) {
            console.log(error);
            alert("错误");
        });

    });



</script>
</html>
